{layout name="layout/common" /}
<style type="text/css">
	.manage_list{
		display: flex;
		align-content: center;
		justify-content: center;
		background: none;
		padding-top: 80px;
	}
	.manage_index {
		width: 27%;
		height: 35px;
		font-size: 16px;
		text-align: center;
		float: left;
		list-style: none;
		list-style-position: outside;
		margin: auto 6px;
	}
	.manage-item{
		position: relative;
		margin:0 10px 0 10px;
		padding: 15px 10px 15px 10px;
		display: flex;
		align-items:center;
		background: #fff;
		border-radius: 5px;
		margin-bottom: 5px;
	}
	.manage-item a{
		width: 84%;
	}
	.item-main{
		position: relative;
	/*	width: 85%;*/
	}
	.manage_result1{
		font-size: 14px;
		color: #fff;
		border-radius: 4px;
		display: inline-block;
		margin-top: 10px;
		height: 22px;
		line-height: 22px;
		text-align: center;
		padding-left: 4px;
		padding-right: 4px;
	}
	.item-integral{
		position: absolute;
		right: 5px;
	}
	.item-integral img{
		width: 50px;
	}
	@media screen and (min-width:301px) and (max-width:350px) {
		.manage-item {
			padding: 10px;
		}
		.manage_list{
			padding-top: 50px;
			padding-bottom: 5px;
			height: 40px;
    		font-size: 14px;
		}
		.manage_main{
			padding-top: 0px;
		}
		/*.item-main{
			width: 80%;
		}*/
		.item-main p:nth-child(1){
			font-size: 14px;
		}
		.manage_result1 {
			margin-top: 5px;
			font-size: 12px;
    		height: 18px;
		}
		.item-integral img{
		width: 35px;
	}
	}
</style>
<div class="register_head">
	<img id='back'	src="__STATIC__/index/img/return.png">
	<p>报备管理</p>
</div>
<div class="manage_list">
	<span class="manage_index all">全部项目</span>
	<span class="manage_index baobei">已报备</span>
	<span class="manage_index sign">已签单 </span>
</div> 
<div class="manage_main">
	<!-- <div class="manage-item">
		<div class="item-main">
			<p>红枫岭一起3栋一单元5-2</p>
			<p class="manage_result1 sucess">&nbsp;报备成功&nbsp;</p>
		</div>
		<div class="item-integral">
			<img src="__STATIC__/index/img/okIntegral.png" width='60px'>
		</div> 
	</div>-->
</div>
<script>
var dataall='';

function ee(type1){

$.post("{:Url('index_ajax')}",{},function(data){
console.log(data);
	dataall = data.data;
	var str=""
	var type;
	switch (type1){
		case 'all':
		type = data.data.all;
		break;
		case 'baobei':
		type = data.data.baobei;
		break;
		case 'sign':
		type = data.data.sign;
		break;
	};
	console.log(type);
	for(var i=0;i<type.length;i++){
			switch(type[i].prostatus){
				case '已报备':
				var color='sucess';
				break;
				case '报备不成功':
				var color='file';
				break;
				case '未签单':
				var color='sign2';
				break;
				case '已签单':
				var color='construction2';
				break;
				case '施工中':
				var color='construction1';
				break;
				case '已完工':
				var color='sign1';
				break;
				default:
			};
				switch(type[i].linkstatus){
				case '无':
				var photo='<img data="积分未申请" src="__STATIC__/index/img/no.png"  class="integral-status" width="50px">';
				break;
				case '已申请':
				var photo='<img data="积分已申请" src="__STATIC__/index/img/noIntegral.png" class="integral-status" width="50px">';
				break;
				case '已发放':
				var photo='<img data="积分已发放" src="__STATIC__/index/img/okIntegral.png" class="integral-status"  width="50px">';
				break;
			};
	 str +='<div class="manage-item">\
				<a href="/index/status/xiangqing?address='+type[i].address+'"><div class="item-main">\
					<p>'+type[i].address.substring(0,type[i].address.length-2)+'*号</p>\
					<p class="manage_result1 '+color +'">'+type[i].prostatus+'</p>\
				</div></a>\
				<div class="item-integral a">'+photo+'</div></div>';
	
	}
	$('.manage_main').html(str);
	
},'json');
}

$('body').on('click','.integral-status',function(){
	var msg = $(this).attr('data');
  	layer.tips(msg, this,{tips: [4, '#6a6666'],time: 500}); 
})

ee('all');
$('.all').css('color','#a62037');
$('.all').click(function(){
	$('.manage_index').css('color','#000');
	ee('all');
	$(this).css('color','#a62037');

})
$('.baobei').click(function(){
	$('.manage_index').css('color','#000');
	ee('baobei');
	$(this).css('color','#a62037');
})
$('.sign').click(function(){
	$('.manage_index').css('color','#000');
	ee('sign');
	$(this).css('color','#a62037');
})

	$(function(){
		$('.txt').css('color',"#000");
		$(".txt2").css('color',"red");
		$('.img1').attr('src',"/static/index/img/icon1-1.png");
		$('.img2').attr('src',"/static/index/img/icon2-2.png");
		$('.img3').attr('src',"/static/index/img/icon3-3.png");
		$('.img4').attr('src',"/static/index/img/icon4-4.png");
		$('.img2').attr('src',"/static/index/img/icon2.png");

		$('.li').click(function(){
			$('.li').css('border-bottom','none');
			$('.li').css('color','');
			$(this).css('color','#a62037');
			$(this).css('border-bottom','2px solid #a62037');
			var type = $(this).attr('data_type');

			$('.box').css('display','none');
			if(type == 'all'){
				$('#all').css('display','table-footer-group');
			}
			if(type == 'baobei'){
				$('#baobei').css('display','table-footer-group');
			}
			if(type == 'sign'){
				$('#sign').css('display','table-footer-group');
			}
		});


	})


</script>
<script>
	$(function(){
		$("#back").click(function(){
		window.history.go(-1);
			//window.location.replace("{:Url('index/index/index')}");
		});
	})
</script>